import request from '@/utils/request';

// 获取购物车数据
export async function getCart() {
  return request.get('/cart');
}

// 更新购物车商品数量
export async function updateCartItem(itemId, quantity) {
  return request.post(`/cart/update?itemId=${itemId}&quantity=${quantity}`);
}

// 删除购物车商品
export async function removeCartItem(itemId) {
  return request.delete(`/cart/remove/${itemId}`);
}

// 获取可用优惠券
export async function getCoupons() {
  return request.get('/cart/coupons');
}